<template>
    <el-time-picker
    v-model="value"
    @change="change"
    :disabled='disabled'
    :style="domCss"
    value-format="HH:mm:ss"
    :picker-options="pickerOptions"
    placeholder="任意时间点">
  </el-time-picker>
</template>

<script>
export default {
    name: 'timePicker',
    props: {
        disabled: {
            type: Boolean,
            default: false
        },
        domCss: {
            type: String,
            default: ''
        },
        pickerOptions: {
            type: Object,
            default: () => {}
        },
        defaultValue: {
            type: String,
            default: ''
        }
    },
    watch: {
        defaultValue: {
            deep: true,
            immediate: true,
            handler: function(v) {
                this.value = v
            }
        }
    },
    data() {
        return {
            value: ''
        }
    },
    methods: {
        change(value) {
            console.log(value, 'times')
            this.$emit("EventHandler", "change",this.$attrs.prop, value);
        }
    }
}
</script>